#ifndef TCP_MASTER_H
#define TCP_MASTER_H

#include "../deviceManger/device.h"
#include <stdint.h>
#include <sys/epoll.h>
#include "../connectionManger/connectionManger.h"


#define BUFFER_SIZE 4096
#define PORT 8080

int Init_tcp_server();
int set_nonblocking(int fd);
int accept_new_sock(int epoll_fd, int server_fd);
int handle_read(DeviceContext *ctx,int epoll_fd);
int handle_disconnect(DeviceContext *ctx,int epoll_fd);
int bind_device(DeviceContext *ctx);
int process_device_data(DeviceContext *ctx);

void process_task(void *arg);

#endif